package top.carrotguo.weibo;

import android.app.Application;
import android.content.Context;
import android.os.Handler;
import android.os.Process;

import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.Logger;


public class MyApplication extends Application {

    private static Context mContext;
    private static Handler mHandler;
    private static int mMainThreadID;

    @Override
    public void onCreate() {
        super.onCreate();
        mContext = getApplicationContext();
        mHandler = new Handler();
        mMainThreadID = Process.myPid();

        //初始化Logger
        Logger.addLogAdapter(new AndroidLogAdapter());
    }

    public static Context getContext(){
        return mContext;
    }

    public static Handler getHandler(){
        return mHandler;
    }

    public static int getMainThreadID(){
        return mMainThreadID;
    }

}
